const person = {
  name: "jw",
  get aliasName() {
    return this.name + "hander";
  },
};
const proxyPerson = new Proxy(person, {
  get(target, key, recevier) {
    console.log(key);
    /*   这里不能写target[key] ,访问proxyPerson.aliasName 读this.name 不走get this指的是没有代理的target 也不用recevier[key],会死循环调用，用Reflect.get(target, key, recevier) */
    // return target[key];
    return Reflect.get(target, key, recevier);
    //Reflect.get(target, key, recevier)相当于recevier[key] 但不全等于 Reflect.get(target, key, recevier)只是改变this指向recevier 再取this.name会 触发一次get()
  },
});
proxyPerson.name = "ttt";
console.log(proxyPerson.aliasName);
